#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QImage>
#include "errorwindow.h"
#include <QSignalMapper>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
private:
    Ui::MainWindow *ui;
    ErrorWindow *error;
    inline void initial();       // initialize the window
    inline void setSignalMappers();
    void setLED(int color);     //0:Red,1:Grenn
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    static QString getPath;
    static QString savePath;
    static QString cameraPath;
    static QSignalMapper *signalMapper;
private slots:
    void recError(QString str);
    void recPath(QString str); // receive undo/redo PATH.
    void recACK(bool); // if undo/redo DONE, to RGB.
    void showImage(QImage* Img);
    void showMessage(QImage* Img);
    void on_Binary_clicked();
    void on_Gray_clicked();
    void on_RGB_clicked();
    void on_actionOpenCamera_triggered();
    void on_actionSavePath_triggered();
    void on_actionCloseCamera_triggered();
    void on_actionOpen_triggered();
    void on_actionSave_triggered();
    void on_actionInverseColor_triggered();
};
#endif // MAINWINDOW_H
